<template>
  <div class="index">
    <div class="title">
      <ul>
        <li><router-link to="/father">prop父传子</router-link></li>
        <li><router-link to="/emitFather">emit子传父</router-link></li>
        <li><router-link to="/mittFather">mitt子传父</router-link></li>
        <li><router-link to="/emitFather">emit子传父</router-link></li>
        <li><router-link to="/modelFather">model子传父</router-link></li>
        <li><router-link to="/refsFather">refsFather子传父</router-link></li>
        <li><router-link to="/injectFather">injectFather传值</router-link></li>
        <li><router-link to="/slotsFather">slotsFather传值</router-link></li>
      </ul>
    </div>
    <div class="content">
      <router-view />
    </div>
  </div>
</template>
<script setup lang="ts"></script>
<style lang="scss" scoped>
.content {
  flex: 1; // 👈 关键：占据剩余所有空间
  width: 100%; // 确保宽度撑满
  border: 1px solid red;
  padding: 20px;
}
.index {
  display: flex;
  // flex-direction: column; // 👈 必须添加，因为 title 和 content 是上下排列
  height: calc(100vh - 50px);
  width: 100%;
}
.title {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
}
</style>
